﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using GMS.BIZ;

namespace Web
{
    public partial class Login : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            Session["test"] = 1;
        }
        protected void Page_LoadComplete(object sender, EventArgs e)
        {
            Session.Remove("test");
            TextBox_Name.Focus();
        }

        protected void ImageButton1_Click(object sender, ImageClickEventArgs e)
        {
            string ok = Resources.ErrorMessage.OK;
            Session.Clear();
            if (ok.CompareTo(Account.Login(TextBox_Name.Text.Trim(), TextBox_PSW.Text.Trim())) == 0)
            {
                Response.Redirect("Information/");
            }
            else Label_Failed.Text = Resources.ErrorMessage.DataNotMatch+",登录失败";
        }    
    }
}
